//判断设备类型并根据设备类型设置font-size
var rem;
var getdevicetype = navigator.userAgent.toLowerCase();

if(getdevicetype.match(/iphone|android|ipad/i)){
    sessionStorage.setItem('DeviceType','Mobile');
    (screen.width > screen.height) ? (rem = screen.height / 15) : (rem = screen.width / 15);
}
else if (getdevicetype.match(/win|mac/i)){
    sessionStorage.setItem('DeviceType', 'Desktop');
    (screen.width > screen.height) ? (rem = screen.height / 44) : (rem = screen.width / 44);
}
else {
    sessionStorage.setItem('DeviceType', 'Other');
    (screen.width > screen.height) ? (rem = screen.height / 44) : (rem = screen.width / 44);
}
$("html").css("font-size",rem);

//引导页移动端适配
var pageWidth;
var pageHeight;

//获取页面宽高
function flex(){
    pageWidth = document.documentElement.clientWidth;
    pageHeight = document.documentElement.clientHeight;

    //部分浏览器使用以上方式获取宽高可能失效，以下代码为备选方案
    (pageWidth == 0)?(pageWidth = document.body.clientWidth):'';
    (pageHeight == 0)?(pageHeight = document.body.clientHeight):'';
}

//引导页页面比例判断函数
function guidePage() {
    flex();
    (pageWidth <= pageHeight)?
    [
        $('#cardbox').css({
            'flex-direction':'column',
            'padding':'0.5rem 1rem',
        }),
        $('footer').hide(),
    ]:[
        $('#cardbox').css({
            'flex-direction': 'row',
            'padding': '0.5rem',
        }),
        $('footer').show(),
    ]
}

//引导页采用Flex移动端适配
//其他页面采用响应式移动端适配